package com.readjoy.readjoyapi.common.annotation;

import jakarta.validation.Constraint;
import jakarta.validation.Payload;
import jakarta.validation.constraints.Pattern;

import java.lang.annotation.ElementType;
import java.lang.annotation.Retention;
import java.lang.annotation.RetentionPolicy;
import java.lang.annotation.Target;

@Target({ElementType.FIELD, ElementType.PARAMETER})
@Retention(RetentionPolicy.RUNTIME)
@Constraint(validatedBy = {})
@Pattern(regexp = "^\\w{6,20}$", message = "密码格式不正确！")
public @interface Password {
    String message() default "密码格式不正确!";
    Class<?>[] groups() default {};
    Class<? extends Payload>[] payload() default {};
}